import java.util.Arrays;
import java.util.Locale;
import java.util.Scanner;

public class Snake {
    /**
     * # 蛇形转驼峰
     * snakeToCamel("my_name") # 转换后的结果：myName
     */
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String str = "";
        System.out.println("请输入蛇形字符串：");
        String instr = scan.next();
        String[] str1 = instr.split("");

        for (int i = 0; i < str1.length; i++) {
            if (str1[i].equals("_")) {
                str1[i] = "";  //去掉 _
                str1[i + 1] = str1[i + 1].toUpperCase(Locale.ROOT);  // _后一位变成大写字母
            }
        }
        for (String item : str1) {
            str += item;
        }
        System.out.println(str);
    }
}

